#include"ConcurrentAlloc.h"

#include<vector>

void testIndex() {
	cout << SizeClass::Index(1025) << endl;
	cout << SizeClass::Index(1025 + 128) << endl;
}

void TestConurrentAlloc() {
	void* ptr1 = ConcurrentAlloc(5);
	void* ptr2 = ConcurrentAlloc(8);
	void* ptr3 = ConcurrentAlloc(8);
	void* ptr4 = ConcurrentAlloc(8);
	void* ptr5 = ConcurrentAlloc(8);
	void* ptr6 = ConcurrentAlloc(8);
	void* ptr7 = ConcurrentAlloc(8);

	ConcurrentFree(ptr1);
	ConcurrentFree(ptr2);
	ConcurrentFree(ptr3);
	ConcurrentFree(ptr4);
	ConcurrentFree(ptr5);
	ConcurrentFree(ptr6);
	ConcurrentFree(ptr7);
}

void testRount(int size) {
	std::vector<void*> x(size);
	for (int i = 0; i < size; ++i)
		x[i]=ConcurrentAlloc(16);

	//for (int i = 0; i < size; ++i) {
	//	if (i == 60000) {
	//		int zzz = i;
	//	}
	//	ConcurrentFree(x[i]);
	//}
		
}

//int main() {
//	//testIndex();
//
//	//TestConurrentAlloc();
//	testRount(100000);
//	return 0;
//
//}
